package com.malty.apimanage.controller;

import com.malty.apisdk.client.ApiClient;
import com.malty.common.domain.Result;
import com.malty.common.util.ResultUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author malty
 */
@Api(tags = "测试")
@RestController
@RequestMapping("/api/test")
public class TestController {
    @Resource
    private ApiClient apiClient;

    @ApiOperation("创建API信息")
    @GetMapping("/repeater")
    public Result<String> addApi(String param) {
        String repeatRobot = apiClient.repeatRobot(param);
        return ResultUtils.success(repeatRobot);
    }
}
